package com.atguigu.boot.controller;

import com.atguigu.boot.bean.Car;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yuen
 * @date 2021-04-07 13:26
 */

@Slf4j
@RestController
public class HelloController {

    @Autowired
        Car car;
    @RequestMapping("/car")
        public Car car(){
            return  car;
        }


    @RequestMapping("/hello2")
    public String handleo1(@RequestParam("name")  String name){

        log.info("请求进来了");
        return "Hello,Spring Boot 2!" + name;



    }
}
